<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<div class='full-center-content-scroll-noheader'>
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#anologChannelDetails"
					data-toggle="tab">模拟通道</a></li>
				<li><a href="#digitChannel" data-toggle="tab">数字通道</a></li>
			</ul>
			<div class="tab-content no-padding">
				<div class="chart tab-pane active" id="anologChannelDetails">
					<h:form id="anologForm">
						<div class="box">
							<div class="box-header" style="padding: 0;">
								<p:toolbar
									rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_glsb') or
											s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_zztd') or
											s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_bj')}">
									<f:facet name="left">
										<p:commandButton value="关联设备" id="relationAn"
											actionListener="#{protectionEquipmentWaveController.getEquipmentByStation}"
											icon="fa fa-link" alt="关联设备" title="关联设备"
											disabled="#{protectionEquipmentWaveController.analogSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_glsb')}">
											<p:ajax event="dialogReturn"
												listener="#{protectionEquipmentWaveController.onAnologSelectorChosen}"
												update="anologForm:anologTb anologForm:msg" />
										</p:commandButton>
										<p:commandButton style="margin-left:2px" id="resetAn"
											actionListener="#{protectionEquipmentWaveController.resetgAnalogChannel()}"
											update=":anologForm:anologTb :form1:msg"
											icon="fa fa-refresh " alt="重置通道" title="重置通道" value="重置通道"
											disabled="#{protectionEquipmentWaveController.analogSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_zztd')}">
											<p:confirm header="提示" message="确定重置通道吗?"
												icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton style="margin-left:2px"
											actionListener="#{protectionEquipmentWaveController.editAnologInfo()}"
											update="anologForm:anologInfoDialog" id="editAn"
											oncomplete="PF('anologInfoDialog').show()"
											icon="fa fa-pencil" alt="编辑" title="编辑" value="编辑"
											disabled="#{protectionEquipmentWaveController.analogSelecteds.size() != 1}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_mntd_bj')}">
										</p:commandButton>
									</f:facet>
								</p:toolbar>
							</div>
							<div class="box-body  full-content-scroll">
								<p:growl id="msg" showDetail="true"></p:growl>
								<p:dataTable id="anologTb" var="anolog" emptyMessage="无记录"
									value="#{protectionEquipmentWaveController.anologInfo}"
									rowKey="#{anolog.id}"
									selection="#{protectionEquipmentWaveController.analogSelecteds}"
									style="margin-bottom:20px;text-align:center"
									paginator="true"
									paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
									<f:facet name="{Customization}">
										<p:outputLabel
											value="总计：#{protectionEquipmentWaveController.anologInfo.size()} 条记录"
											style="margin-right:20px;"></p:outputLabel>
									</f:facet>
									<p:ajax event="rowSelectCheckbox"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowUnselectCheckbox"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowSelect"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowUnselect"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:column selectionMode="multiple"
										style="width:40px;text-align:center" />
									<p:column headerText="通道号"
										style="width:80px;text-align: center">
										<h:outputText value="#{anolog.no}" />
									</p:column>
									<p:column headerText="通道名称">
										<h:outputText value="#{anolog.name}" />
									</p:column>
									<p:column headerText="关联设备">
										<h:outputText value="#{anolog.equipmentName}" />
									</p:column>
								</p:dataTable>
								<p:dialog id="anologInfoDialog" widgetVar="anologInfoDialog"
									height="150px">
									<p:toolbar>
										<f:facet name="right">
											<p:commandButton value="确定"
												actionListener="#{protectionEquipmentWaveController.saveAnologInfo}"
												update="form1:msg anologTb"
												oncomplete="PF('anologInfoDialog').hide()" />
										</f:facet>
									</p:toolbar>
									<p:panelGrid columns="2">
										<p:outputLabel value="通道名称" />
										<p:inputText style="width:300px"
											value="#{protectionEquipmentWaveController.analogSelected.name}" />
									</p:panelGrid>
								</p:dialog>
							</div>
						</div>
						<div class="box-footer"></div>
					</h:form>
				</div>
				<div id="digitChannel" class="chart tab-pane">
					<h:form id="digitForm">
						<div class="box">
							<div class="box-header" style="padding: 0;">
								<p:toolbar
									rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_glsb') or
								s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_zztd') or 
								s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_bj')}">
									<f:facet name="left">
										<p:commandButton
											actionListener="#{protectionEquipmentWaveController.getEquipmentByStation}"
											icon="fa fa-link" alt="关联设备111" title="关联设备" value="关联设备"
											id="relationDigBtn"
											disabled="#{protectionEquipmentWaveController.digitSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_glsb')}">
											<p:ajax event="dialogReturn"
												listener="#{protectionEquipmentWaveController.onDigitSelectorChosen}"
												update="digitTb  anologForm:msg" />
										</p:commandButton>
										<p:commandButton icon="fa fa-refresh " alt="重置通道" value="重置通道"
											id="resetDigBtn"
											disabled="#{protectionEquipmentWaveController.digitSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_zztd')}"
											title="重置通道" style="margin-left:2px"
											actionListener="#{protectionEquipmentWaveController.resetgDigitalChannel()}"
											update=":digitForm:digitTb :form1:msg">
											<p:confirm header="提示" message="确定重置通道吗?"
												icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton icon="fa fa-pencil" alt="编辑" title="编辑"
											value="编辑" id="editDigBtn"
											disabled="#{protectionEquipmentWaveController.digitSelecteds.size() != 1}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_bhsbpz_sztd_bj')}"
											style="margin-left:2px" update="digitForm:digitInfoDialog"
											actionListener="#{protectionEquipmentWaveController.editDigitInfo()}"
											oncomplete="PF('digitInfoDialog').show()" />
									</f:facet>
								</p:toolbar>
							</div>
							<div class="box-body full-content-scroll" >
								<p:dataTable id="digitTb" var="digit" emptyMessage="无记录"
									value="#{protectionEquipmentWaveController.digitInfo}"
									rowKey="#{digit.id}"
									selection="#{protectionEquipmentWaveController.digitSelecteds}"
									style="margin-bottom:20px;text-align: center"
									paginator="true"
									paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
									<f:facet name="{Customization}">
										<p:outputLabel
											value="总计：#{protectionEquipmentWaveController.digitInfo.size()} 条记录"
											style="margin-right:20px;"></p:outputLabel>
									</f:facet>
									<p:ajax event="rowSelectCheckbox"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowUnselectCheckbox"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowSelect"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowUnselect"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:column selectionMode="multiple"
										style="width:40px;text-align:center" />
									<p:column headerText="通道号"
										style="width:80px;text-align: center">
										<h:outputText value="#{digit.no}" />
									</p:column>
									<p:column headerText="通道名称">
										<h:outputText value="#{digit.name}" />
									</p:column>
									<p:column headerText="关联设备">
										<h:outputText value="#{digit.equipmentName}" />
									</p:column>
								</p:dataTable>
								<p:dialog id="digitInfoDialog" widgetVar="digitInfoDialog"
									height="150px">
									<p:toolbar>
										<f:facet name="right">
											<p:commandButton value="确定"
												actionListener="#{protectionEquipmentWaveController.saveCfgDigitalChannel}"
												update="form1:msg digitTb "
												oncomplete="PF('digitInfoDialog').hide()" />
										</f:facet>
									</p:toolbar>
									<p:panelGrid columns="2">
										<p:outputLabel value="通道名称" />
										<p:inputText style="width:300px"
											value="#{protectionEquipmentWaveController.digitSelected.name}" />
									</p:panelGrid>
								</p:dialog>
							</div>
							<div class="box-footer"></div>
						</div>
					</h:form>
				</div>
			</div>
		</div>
	</div>

</ui:composition>